<script>
    var returLocations = new Array();
<? foreach ( $locations as $key => $location ): ?>

        <?
        foreach ( $location as $loc ):
            if ( $loc->is_return == 1 ):
                ?>
                    returLocations.push('<?= $loc->ID ?>');
                <?
            endif;
        endforeach;
        ?>

    <? endforeach; ?>

</script>

<div id="wrap" class="clearfix">
    <div id="aside">
        <div id="changeDetasilsBox" <? if ( $method == 'browse_car_details' ) echo "style='display:none'"; ?>>
            <? $this->load->view ( 'rentacar/parts/your_details' ) ?>
        </div>
        <div id="serchModule" <? if ( $method == 'browse_car_details' ) echo "style='display:block'"; ?>>
            <? $this->load->view ( 'rentacar/parts/search_box' ) ?>
        </div>
		<? $this->load->view('destinations/parts/banner') ?>
    </div><!-- / Aside -->

    <div id="main">

        <div class="title">
            <? $pices = explode ( " ", $car->name ); ?>

            <h1><span><?= $pices[0] ?></span><?
                    for ( $j = 1; $j <= count ( $pices ) - 1; $j++ )
                    {
                        echo ' ' . $pices[$j];
                    }
                ?></h1>

        </div>

        <div class="details-page clearfix">   
            <?
                $filename = get_thumbnail ( 273, 206, $images[0]->filename );
            ?>
            <img src="<?= $hosting ?>pro-gallery/<?= $car->g_path . '/' . $filename ?>" alt="" class="details-thumb">   
            <div class="details-info">
                <p><?= clean_html_p ( $car->description ) ?></p>
                <div class="star-rating-box">
                    <small><?= lang ( 'rentacar.score' ) ?>: <?= round ( $car->score, 2 ) ?></small>
                    <? $this->load->view ( 'rentacar/parts/rating', array ('no' => 1, 'score' => round ( $car->score / 2 )) ); ?>
                </div>
                <span class="consumption"><?= number_format ( $car->fuel_consumption, 1, ',', ' ' ) ?> l/100km</span>

                <big><?= $car->day13price; ?>€ <span>/ <?= lang ( 'rentacar.day' ) ?></span></big>

            </div>

            <? if ( isset ( $not_available ) && $not_available != FALSE ): ?>

                    <div style="clear: both"></div>

                    <div class="available_info">

                        <span class="exclamation">&nbsp;!&nbsp;</span>
                        <div class="not-available"><?= lang ( 'not.availble.in.this.period' ) ?>.</div>

                    </div>

                <? endif; ?>

            <div class="details-book-now">
                <div class="three-col">
                    <div class="right book-price">
                        <div>

                            <big><span><?= lang ( 'rentacar.total' ) ?>:</span> 
                                <?
                                    if ( $method != 'browse_car_details' )
                                    {
                                        echo $this->booking_session->get ( 'tot_price' );
                                    }
                                    else
                                        echo "0";
                                ?>€</big>

                        </div>

                        <a href="<?= base_url ( 'rentacar/checkout/' . urlify::filter ( $car->name ) . '-' . $car->id ) ?>" class="button" id="go_to_checkout"><?= lang ( 'rentacar.book.now' ) ?> &raquo;</a>

                    </div>
                    <ul class="two-columns clearfix">
                        <h3 class='descriptive-non-visible'><?= lang ( 'online_booking' ); ?></h3>
                        <li class="left">
                            <h5><?= lang ( 'rentacar.pickup' ) ?></h5>

                            <ul class="side-form">

                                <li class="clearfix">
                                    <label><?= lang ( 'rentacar.from' ) ?></label>
                                    <input type="text" class="datepicker" id="datefrom2">
                                </li>

                                <li class="clearfix">
                                    <label><?= lang ( 'rentacar.time' ) ?></label>
                                    <? echo makefull ( '', 15, 'id="fullfrom2" class="dropdownized"' ); ?>
                                </li>

                                <li class="clearfix">
                                    <select class="dropdownized" id="pickup_loc_id2" name="">

                                        <? foreach ( $locations as $key => $location ): ?>
                                                <optgroup label="<?= $key ?>">

                                                    <? foreach ( $location as $loc ): ?>
                                                        <option value="<?= $loc->ID ?>"><?= $loc->name; ?> <? if ( $loc->price != "0" ) echo " +$loc->price &euro;"; ?></option>
                                                    <? endforeach; ?>

                                                </optgroup>
                                            <? endforeach; ?>

                                    </select>
                                </li>

                            </ul>
                        </li>

                        <li class="right">
                            <h5><?= lang ( 'rentacar.return' ) ?></h5>
                            <ul class="side-form">

                                <li class="clearfix">
                                    <input type="text" class="datepicker" id="dateto2">
                                </li>

                                <li class="clearfix">
                                    <? echo makefull ( '', 15, 'id="fullto2" class="dropdownized"' ); ?>
                                </li>

                                <li class="clearfix">
                                    <select class="dropdownized" id="return_loc_id2" name="">

                                        <? foreach ( $locations as $key => $location ): ?>
                                                <optgroup label="<?= $key ?>">

                                                    <? foreach ( $location as $loc ): ?>
                                                        <option value="<?= $loc->ID ?>"><?= $loc->name; ?> <? if ( $loc->price != "0" ) echo " +$loc->price &euro;"; ?></option>
                                                    <? endforeach; ?>

                                                </optgroup>
                                            <? endforeach; ?>

                                    </select>
                                </li>

                            </ul>
                        </li>
                    </ul>

                </div>
            </div>

            <h2><?= lang ( 'rentacar.technical.details' ) ?></h2>
            <div class="technical-details">

                <ul class="tech-spec">
                    <li><?= lang ( 'rentacar.engine' ) ?>: <span><?= $car->engine; ?></span></li> 
                    <li><?= lang ( 'rentacar.max.power' ) ?>: <span><?= $car->maxpower; ?></span></li>
                    <li><?= lang ( 'rentacar.max.speed' ) ?>: <span><?= $car->maxspeed; ?> km/h</span></li>
                    <li><?= lang ( 'rentacar.consumption' ) ?>: <span><?= number_format ( $car->fuel_consumption, 1, ',', ' ' ) ?> l/100km</span></li>
                    <li><?= lang ( 'rentacar.transmission' ) ?>: <span><?
                                if ( $car->auto_transmission == 1 )
                                {
                                    echo lang ( 'rentacar.automatic' );
                                }
                                else
                                {
                                    echo lang ( 'rentacar.manual' );
                                }
                            ?> </span></li>
<!--                    <li><?= lang ( 'rentacar.luggage.space.capacity' ) ?>: <span><?= $car->luggage_capacity ?></span></li>-->
                </ul>

                <ul class="spec">
                    <li class="people"><?= lang ( 'rentacar.seat.count' ) ?>: <span><?= $car->seat_count ?></span></li>
                    <li class="doors"><?= lang ( 'rentacar.number.of.doors' ) ?>: <span><?= $car->num_of_doors ?></span></li>
                    <li class="luggage"><?= lang ( 'rentacar.luggage.space.capacity' ) ?>: <span><?= $car->luggage_capacity ?></span></li>
<!--                    <li class="automatic"><?= lang ( 'rentacar.automatic.transmission' ) ?>: <span><?
                        if ( $car->auto_transmission )
                        {
                            echo '√';
                        }
                        else
                        {
                            echo 'x';
                        }
                    ?></span></li>-->
                    <li class="aircondition">A/C: <span><?
                                if ( $car->ac )
                                {
                                    echo '√';
                                }
                                else
                                {
                                    echo 'x';
                                }
                            ?></span></li>
                    <li class="fuel"><?= lang ( 'rentacar.fuel' ) ?>: <span><?
                                if ( $car->diesel )
                                {
                                    echo 'D';
                                }
                                else
                                {
                                    echo 'B';
                                }
                            ?></span></li>
                    <li class="polution"><?= lang ( 'rentacar.emmision' ) ?>: <span><?= $car->co2 ?> g/kga</span></li>
                </ul>
            </div>

            <h2><?= lang ( 'rentacar.vehicle.equipment' ) ?></h2>
            <p><?= strip_tags ( $car->equipment, '<p><a><h1><h2><h3><h4><h5><h6><b><strong>' ) ?></p>

            <h2><?= lang ( 'rentacar.gallery' ) ?></h2>
            <ul class="thumb-list">

                <?
                    if ( isset ( $images ) ):
                        array_splice ( $images, 0, 1 );
                        foreach ( $images as $image ):
                            $filename = get_thumbnail ( 176, 127, $image->filename );
                            $prevfilename = get_thumbnail ( 800, 600, $image->filename );
                            ?>
                            <li>
                                <a rel="lightbox" title="<?= $car->name ?>" href="<?= $hosting ?>pro-gallery/<?= $car->g_path . '/' . $prevfilename ?>">
                                    <img src="<?= $hosting ?>pro-gallery/<?= $car->g_path . '/' . $filename ?>" alt="">
                                </a>
                            </li>
                            <?
                        endforeach;
                    endif;
                ?>
            </ul>

            <h2>Video</h2>
            <div class="video-placeholder">
                <!--<img src="<?= base_url () ?>assets/pictures/car-video-sample.jpg" alt="">-->
                <?
                    if ( isset ( $video ) )
                    {
                        ?>
                        <iframe width="547" height="275" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/<?= $video->link ?>?rel=0&amp;wmode=transparent" type="text/html" class="youtube-player" title="YouTube video player"></iframe>
                        <?
                    }
                    else
                        echo 'No video.';
                ?>
            </div>

        </div><!-- / Three Columns -->

    </div><!-- / Mian -->

</div><!-- / Wrap -->